<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title></title>

    <link href="{$DIR}static/sbadmin/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link
        href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
        rel="stylesheet">
    <link href="{$DIR}static/sbadmin/css/sb-admin-2.min.css" rel="stylesheet">
    <link href="{$DIR}static/bootstrap-fileinput/css/fileinput.min.css" rel="stylesheet">
</head>

<body id="page-top">

    <!-- Page Wrapper -->
    <div id="wrapper">

        <!-- Sidebar -->
        <!-- End of Sidebar -->

        <!-- Content Wrapper -->
        <div id="content-wrapper" class="d-flex flex-column">

            <!-- Main Content -->
            <div id="content">

                <!-- Topbar -->
                <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">


                    <!-- Topbar Navbar -->
                    <ul class="navbar-nav ml-auto">

                        <!-- Nav Item - Search Dropdown (Visible Only XS) -->
                        <li class="nav-item dropdown no-arrow d-sm-none">
                            <!-- Dropdown - Messages -->
                            <div class="dropdown-menu dropdown-menu-right p-3 shadow animated--grow-in"
                                aria-labelledby="searchDropdown">
                                <form class="form-inline mr-auto w-100 navbar-search">
                                    <div class="input-group">
                                        <input type="text" class="form-control bg-light border-0 small"
                                            placeholder="Search for..." aria-label="Search"
                                            aria-describedby="basic-addon2">
                                        <div class="input-group-append">
                                            <button class="btn btn-primary" type="button">
                                                <i class="fas fa-search fa-sm"></i>
                                            </button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </li>

                        <div class="topbar-divider d-none d-sm-block"></div>

                        <!-- Nav Item - User Information -->
                        <li class="nav-item dropdown no-arrow">
                            <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button"
                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <span class="mr-2 d-none d-lg-inline text-gray-600 small"></span>
                                <img class="img-proFILE rounded-circle" src="" style="width: 50px;">
                            </a>
                            <!-- Dropdown - User Information -->
                            <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
                                aria-labelledby="userDropdown">
                                <a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">
                                    <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
                                    退出登录
                                </a>
                            </div>
                        </li>

                    </ul>

                </nav>

                <!-- Begin Page Content -->
                <div class="container-fluid" id="maindiv" style="min-height: 600px;">
                </div>
                <!-- /.container-fluid -->

            </div>
            <!-- End of Main Content -->



            <!-- Footer -->
            <footer class="sticky-footer bg-white">
                <div class="container my-auto">
                    <div class="copyright text-center my-auto">
                        <span>Copyright &copy; yiban.hbu.cn 2021</span>
                    </div>
                </div>
            </footer>
            <!-- End of Footer -->

        </div>
        <!-- End of Content Wrapper -->

    </div>
    <!-- End of Page Wrapper -->

    <!-- Scroll to Top Button-->
    <a class="scroll-to-top rounded" href="#page-top">
        <i class="fas fa-angle-up"></i>
    </a>

    <div class="modal fade" id="changeinformation" tabindex="-1" role="dialog" aria-labelledby="changeinformationLabel"
        aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">更改信息</h5>
                    <button type="button" class="close" id="closebutton" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <form style="width: 70%; margin-left: 10%;padding-bottom: 10%;">
                        <div class="form-group">
                            <label for="name" class="col-form-label">姓名</label>
                            <input type="text" class="form-control" id="name">
                        </div>
                        <div class="form-group">
                            <label for="sex" class="col-form-label">性别</label>
                            <input type="text" class="form-control" id="sex">
                        </div>
                        <div class="form-group">
                            <label for="collage" class="col-form-label">学院（全称）</label>
                            <input type="text" class="form-control" id="collage">
                        </div>
                        <div class="form-group">
                            <label for="major" class="col-form-label">专业</label>
                            <input type="text" class="form-control" id="major">
                        </div>
                        <div class="form-group">
                            <label for="qq" class="col-form-label">QQ</label>
                            <input type="text" class="form-control" id="qq">
                        </div>
                        <div class="form-group">
                            <label for="tel" class="col-form-label">TEl</label>
                            <input type="phone" class="form-control" id="tel">
                        </div>
                        <div class="form-group">
                            <label for="dormitory" class="col-form-label">宿舍</label>
                            <input type="text" class="form-control" id="dormitory">
                        </div>
                        <div class="form-group">
                            <label for="home" class="col-form-label">故乡</label>
                            <input type="text" class="form-control" id="home">
                        </div>
                        <div class="form-group">
                            <label for="firstwant" class="col-form-label">第一志愿</label>
                            <select class=" form-control form-select" id="firstwant">
                                <option value="综合运营部">综合运营部</option>
                                <option value="策划推广部">策划推广部</option>
                                <option value="信息采编部">信息采编部</option>
                                <option value="视觉设计部">视觉设计部</option>
                                <option value="网络维护部">网络维护部</option>
                                <option value="技术开发部">技术开发部</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="secondwant" class="col-form-label">第二志愿</label>
                            <select class=" form-control form-select" id="secondwant">
                                <option value="综合运营部">综合运营部</option>
                                <option value="策划推广部">策划推广部</option>
                                <option value="信息采编部">信息采编部</option>
                                <option value="视觉设计部">视觉设计部</option>
                                <option value="网络维护部">网络维护部</option>
                                <option value="技术开发部">技术开发部</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="secondwant" class="col-form-label">服从调剂</label>
                            <select class=" form-control form-select" id="ifadjust">
                                <option value="1">服从</option>
                                <option value="0">不服从</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="selfintro">自我介绍与评价</label>
                            <textarea class="form-control" id="selfintro" rows="4"></textarea>
                        </div>
                        <div class="form-group">
                            <label for="habits">爱好/特长</label>
                            <textarea class="form-control" id="habits" rows="4"></textarea>
                        </div>
                        <div class="form-group">
                            <label for="ybthink">对易班的认识</label>
                            <textarea class="form-control" id="ybthink" rows="4"></textarea>
                        </div>
                        <img src="" style="width:80%" id="header">
                        <input id="picture" type="file" name="image" />
                        <div class="modal-footer">
                            <button type="button" class="btn btn-primary" id="updatabutton">更新</button>
                            <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                        </div>
                    </form>
                </div>

                <hr />
            </div>
        </div>
    </div>
    <!-- Bootstrap core JavaScript-->
    <script src="{$DIR}static/sbadmin/vendor/jquery/jquery.min.js"></script>
    <script src="{$DIR}static/bootstrap-fileinput/js/fileinput.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.3.5/js/locales/zh.min.js"></script>
    <script src="{$DIR}static/sbadmin/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
    <!-- Core plugin JavaScript-->
    <script src="{$DIR}static/sbadmin/vendor/jquery-easing/jquery.easing.min.js"></script>
    <!-- Custom scripts for all pages-->
    <script src="{$DIR}static/sbadmin/js/sb-admin-2.min.js"></script>
    <script src="{$DIR}static/qrcode.js"></script>
    <script>
        //请求state
        $.ajax({
            url: '{$DIR}' + "/index.php/index/index/content",
            type: "GET",
            success: function (result) {
                //更改这个div内部内容
                $('#maindiv').html(result);

            },
            error: function (ex) {
                console.log(ex)
            }
        })
        //保存信息
        function saveInfo() {
            $.ajax({
                url: '{$DIR}' + "/index.php/index/index/saveInfo",
                type: "POST",
                data: {
                    //获取表单填写的value   
                    "name": $('#name').val(),
                    "sex": $('#sex').val(),
                    "major": $('#major').val(),
                    "collage": $('#collage').val(),
                    "QQ": $('#qq').val(),
                    "tel": $('#tel').val(),
                    "home": $('#home').val(),
                    "dormitory": $('#dormitory').val(),
                    "firstwant": $('#firstwant').val(),
                    "secondwant": $('#secondwant').val(),
                    "selfintro": $('#selfintro').val(),
                    "habits": $('#habits').val(),
                    "ybthink": $('#ybthink').val(),
                    'ifadjust': $('#ifadjust').val(),
                    'image_src': $('#header').attr('src'),
                },
                success: function (result) {
                    console.log(result);
                    $('#maindiv').html(result)
                },
                error: function (ex) {
                    console.log(ex)
                }
            })
        }
        //获取form.html内容
        function getinfoform() {
            $.ajax({
                url: '{$DIR}' + "/index.php/index/index/formContent",
                type: "GET",
                success: function (result) {
                    $('#maindiv').html(result);

                },
                error: function (ex) {
                    console.log(ex)
                }
            })
        }
    </script>
</body>

</html>